<?php
namespace Home\Controller;

class ArchiveController extends HomeBaseController
/**
 * 成交记录
 */
{
    public function index(){
        
        $page=I('page',1);
        $size=200;
        $start=($page-1)*$size;
        //交易记录  select a.domain,a.price,a.creatdate,b.name from dd_domain_transdetail a left join dd_domain_type b on a.domain_type_id=b.id limit 1,50;
        $list = M('DomainTransdetail')->table('dd_domain_transdetail a, dd_domain_type b')->where('a.domain_type_id = b.id')->
            field('a.domain as domain,a.price as price,a.creatdate as creatdate,b.name as name')->order('a.creatdate desc' )->limit($start,$size)->select();
        
        $count = M('DomainTransdetail')->table('dd_domain_transdetail a, dd_domain_type b')->where('a.domain_type_id = b.id')->count();
        $this->assign('count', $count);
        $this->assign('list', $list);
        $this->assign('page', $page);
        $this->assign('pageNum', $count%$size);
        $this->display('archive/index');
    }
    
}

?>